window.onload = function(){
    new Vue({
        el:'#my',
        data:{
            name:'Hanley',
            age:18,
            imgurl:'/zone/img/logo.jpg',
            imgtitle:'测试图片标题',
            flag:true,
            a1:'a1',
            a2:'a2',
            // a3:'a3',
            obj:{a:'a0',b:'b0'},
            arr:['a','b','c','d'],
            lists:[{name:'oppo',state:0},
            {name:'vivo',state:0},
            {name:'Appale',state:1}]
        },
        methods:{
            add:function(name){
                this.lists.unshift({name:name,state:1});
            },
            del:function(index){
                this.lists.splice(index,1);
            },
            mouseover:function(){
                this.age = 20;
            },
            mouseout:function(){
                this.age=19;
            },
            dblclick:function(){
                alert("双击了");
            }
        },
        filters:{
            stateFilter:function(type){
                switch(type){
                    case 1:
                        return '已经采购';
                    case 0:
                        return '还没采购';
                }
            }
        }
    });
}

